
#ifndef TEXTEDITOR_H
#define TEXTEDITOR_H

#include <BButton>
#include <BLineEdit>
#include <BTextEdit>

#include "TextFormat.h"
#include "FormatDialog.h"

class TextEditor : public BTextEdit
{
	BOBJECT(TextEditor);
public:
	TextEditor(BWidget* parent = 0);
	~TextEditor();

protected:
	void slotAssetChanged(BWidget* widget, const BValue& value);

	void slotTextEditStyled(BWidget* widget, const BValue& value);
	void slotTextEditFramed(BTextEdit* textEdit);
	void slotTextSelectionChanged(BWidget* widget, const BValue& value);
	void slotTextEditWheeled(BWidget* widget, const BValue& value);

	void slotClearButtonClicked(BObject* object, const BValue& value);
	void slotFontButtonClicked(BObject* object, const BValue& value);
	void slotColorButtonClicked(BButton* button, const BValue& value);
	void slotShowPunctMenuTriggered(BMenu* menu, const BValue& value);

protected:
	virtual void styleEvent(const BEvent& event);

private:
	BButton*			_clearButton;
	BButton*			_fontButton;
	BButton*			_colorButton;
	BButton*			_groundButton;
	BButton*			_viewButton;
	FormatDialog*		_formatDialog;

};

#endif
